<template>
  <div>
    <h1>{{msg}}</h1>
    <h2>姓名:{{ name }}</h2>
    <h2>性别:{{ gender }}</h2>
    <h2>年龄:{{ myAge }}</h2>
    <button @click="addAge">点我涨一岁</button>
  </div>
</template>

<script>
export default {
  name: "StudentVue",
  data() {
    return {
      msg: "Hello,Everyone!",
      myAge : this.age
    };
  },
  //props:['gender','name','age'],
  props:{
    name :{
      type:String,
      required:true,
    },
    age:{
      type:Number,
      default: 99
    },
    gender:String
  },
  methods:{
    addAge(){
      this.myAge++;
    }
  }
};
</script>

<style>

</style>